import os
import openpyxl
import myglobal
import config_json
import getpath
def ejff():
    if config_json.setting["ejff_file"]==None or config_json.setting["ejff_file"]=="":
        fname=os.path.join(getpath.getpath(),"ejff.xlsx")
    else:
        fname=config_json.setting["ejff_file"]
    print(fname)
    if not os.path.exists(fname):
        return []
    xl_book = openpyxl.load_workbook(filename=fname)
    table = xl_book.worksheets[0]
    data = []
    for row in table.values:
        r = []
        for one in row:
            r.append(one)
        data.append(r)
    data.sort()
    return data
if __name__=="__main__":
    config_json.read_setting()
    data=ejff()
    wb = openpyxl.Workbook()
    ws = wb.active
    for one in data:
        if one==None:
            continue
        if one[1]==None:
            continue
        if "拉伸" in one[1]:
            ws.append(one)
    wb.save("ejff_拉伸.xlsx")
